package com.example.mapboot.utils;

import cn.hutool.http.HttpUtil;
import com.alibaba.rocketmq.shade.com.alibaba.fastjson.JSON;
import com.example.mapboot.dto.covid.CovidDTO;

public class CovidUtils {

    public static CovidDTO getCovid(){
        //https://c.m.163.com/ug/api/wuhan/app/data/list-total
//        String result = RequestUtils.loadJSON("https://c.m.163.com/ug/api/wuhan/app/data/list-total");
        String result = HttpUtil.get("https://c.m.163.com/ug/api/wuhan/app/data/list-total");
        return JSON.parseObject(result, CovidDTO.class);
    }

    public static void main(String[] args) {
        CovidDTO covid = getCovid();
        System.out.println(covid);
    }
}
